﻿using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
namespace TNO.Education.SearchResultBox
{
    [ToolboxItemAttribute(false)]
    public class SearchResultBox : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/TNO.Education/SearchResultBox/SearchResultBoxUserControl.ascx";

        public SearchResultBox()
        {
            this.ChromeType = PartChromeType.None;
        }

        #region Properties

        public static string _url = "tra-cuu-tuyen-sinh-dai-hoc.aspx";
        [Personalizable(PersonalizationScope.Shared),
        WebBrowsable(true), WebDisplayName("Url"), Category("Customize"), Microsoft.SharePoint.WebPartPages.FriendlyName("URL"), Description("Url")]
        public string URL
        {
            get
            {
                return _url;
            }
            set
            {
                _url = value;
            }
        }

        public static string _chuthich = string.Empty;
        [Personalizable(PersonalizationScope.Shared),
        WebBrowsable(true), WebDisplayName("Ghi chú"), Category("Customize"), Microsoft.SharePoint.WebPartPages.FriendlyName("Note"), Description("Ghi chú")]
        public string Chuthich
        {
            get
            {
                return _chuthich;
            }
            set
            {
                _chuthich = value;
            }
        }

        public static bool _displayUniversity = false;
        [Personalizable(PersonalizationScope.Shared),
        WebBrowsable(true), WebDisplayName("Hiển thị trường đại học"), Category("Customize"), Microsoft.SharePoint.WebPartPages.FriendlyName("Num"), Description("Hiển thị trường đại học")]
        public bool DisplayUniversity
        {
            get
            {
                return _displayUniversity;
            }
            set
            {
                _displayUniversity = value;
            }
        }
        #endregion

        protected override void CreateChildControls()
        {
            Control control = Page.LoadControl(_ascxPath);
            Controls.Add(control);
        }
    }
}
